﻿<section id="_test_1" data-transition="slide">
	<!--Header-->
    <div class="header" data-fixed="top">
        <div class="title row-box">
            <div class="box-left" onClick="ui.Page.back();" style="background-color: yellowgreen;">
                 <i class="fa icon-left-open"></i>
            </div>
            <div class="span1">
                <h1 id="txt_title">星火接口演示-关于应用</h1>
            </div>
            <div class="box-right" onclick="ui.Page.refresh();" style="background-color: orangered;">
                <i class="fa icon-spin5"></i>
            </div>
        </div>
    </div>

    <!--Content-->
    <div class="content">
        <div id="cc" style="padding:20px; background-color: green;">
            请求测试
        </div>
        <div id="bb" style="padding:20px; background-color: rgb(195, 141, 216);">
            报错测试
        </div>
    </div>
</section>
<script type="text/javascript">
	app.section.onReady=function(params){
		console.log('页面传值 = ',params)
	};
	
	app.section.onLoad=function(params){
		console.log(2)
	};
	
	app.section.onBack=function(a,b){
        console.log('我回去了 = ',a,b);
    };
    

    $('#cc').on('tap', function () {
        $app.loading()
        $app.postAjax('user/login', {
            loginName: 'xxj2018',
            password: '123'
        }, function (res) {
            console.log('成功', res);
        }, function (res) {
            console.log('失败', res);
        })
    });
    $('#bb').on('tap', function () {
        // $app.toast('真的码',true);
        // $app.alert('无敌最寂寞无敌最寂寞')
        // $app.confirm('今晚吃饭吗？','二选一',{
        // 	yesText:'确定1',
        // 	yesFun:function(){
        // 		console.log(1111);
        // 	},
        // 	noText:'取消1',
        // 	noFun:function(){
        // 		console.log(2222);
        // 	}
        // });



        $app.loading();
        $app.postAjax('user/wrong', {}, function (res) {
            console.log('成功', res);
        }, function (res) {
            console.log('失败', res);
        })
    });
</script>